* This file replicates the results reported in Dahl and Gleditsch 
* "Clouds with Silver Linings: How Mobilization 
* Shapes the Impact of Coups on Democratization"
*
* mdahl@prio.org, ksg@essex.ac.uk
* 
* this version: 2022-11-15


**************************************************************************************************************
* TABLE 1: Coups, outcome, protest and changes in Polity (1950-2019), OLS with country-fixed effects		 *
**************************************************************************************************************
use "Maindataset.dta", clear
xtset country_id year


eststo clear
preserve
drop if polity_1>=7
eststo NONDEM1: xtreg politychange coup_d2  log_gdpcap_1 gdpgrowth_1 lead_dur_1  armedconflict_1 pdemnb_polity_1 coldwar nonviol_other_1 moret, fe
eststo NONDEM2: xtreg politychange coup_d2 Protest_d2 pro_coup_d2 log_gdpcap_1 gdpgrowth_1 lead_dur_1  armedconflict_1 pdemnb_polity_1 coldwar nonviol_other_1 moret, fe
eststo NONDEM3: xtreg politychange Fcoup_d2  Scoup_d2 pro_Scoup_d2 pro_Fcoup_d2 Protest_d2 log_gdpcap_1 gdpgrowth_1 lead_dur  armedconflict_1 pdemnb_polity_1 coldwar nonviol_other_1 moret, fe
restore 


eststo ALL1: xtreg politychange coup_d2  log_gdpcap_1 gdpgrowth_1 lead_dur_1  armedconflict_1 pdemnb_polity_1 coldwar nonviol_other_1 moret, fe
eststo ALL2: xtreg politychange coup_d2 Protest_d2 pro_coup_d2 log_gdpcap_1 gdpgrowth_1 lead_dur_1  armedconflict_1 pdemnb_polity_1 coldwar nonviol_other_1 moret, fe
eststo ALL3: xtreg politychange Fcoup_d2  Scoup_d2 pro_Scoup_d2 pro_Fcoup_d2 Protest_d2 log_gdpcap_1 gdpgrowth_1 lead_dur  armedconflict_1 pdemnb_polity_1 coldwar nonviol_other_1 moret, fe


esttab using "main.tex", replace order(coup_d2   pro_coup_d2 Scoup_d2  pro_Scoup_d2 Fcoup_d2 pro_Fcoup_d2 Protest_d2   )  ///
nonumbers mtitles(  "Non-Democracies" "Non-Democracies" "Non-Democracies" "All regimes" "All regimes" "All regimes" "Democracies" "Democracies" "Democracies") ///
coeflabels(coup_d2 "Coup, decay: $\alpha=2$" Protest_d2 "Protest, decay: $\alpha=2$" pro_coup_d2 "Protest*coup: $\alpha=2$"  ///
 coup_w2 "Coup last 2 years" Protest_w2 "Protest last 2 years" ///
 pro_coup_w2 "Protest*coup, 2 years window"  log_gdpcap_1 "Log GDP per capita, t--1" gdpgrowth_1 "Economic growth, t--1" ///
regdur "Log regime duration" lead_dur_1 "Log incumbent's time in office" coldwar "Cold War" ///
armedconflict_1 "Ongoing armed conflict" pdemnb_polity_1 "Democratic neighborhood"  _cons "Constant" Scoup_d2 "Successful coup, decay: $\alpha=2$" ///
 pro_Fcoup_d2 "Protest* Failed coup: $\alpha=2$" nonviol_other_1 "Other non-violent campaign, t--1" morethanonecoup  "More than one coup, t--1" ///
Fcoup_d2 "Failed coup, decay: $\alpha=2$"  pro_Scoup_d2 "Protest* successful coup: $\alpha=2$") scalars("ll Log lik." "bic")


